﻿using LayuiMvc.DataEntity.DataEntity;
using LayuiMvc.DataEntity.IdentityEntity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LayuiMvc.DataEntity.DataEntity
{
    /// <summary>
    /// 帖子收藏实体类
    /// </summary>
    [Table("PostCollection")]
    public class PostCollectionEntity
    {
        /// <summary>
        /// 收藏ID
        /// </summary>
        [Key]
        public int CollectionId { get; set; }

        /// <summary>
        /// 帖子Id
        /// </summary>
        [ForeignKey("Post")]
        public int  PostId { get; set; }

        /// <summary>
        /// 收藏用户ID
        /// </summary>
        [ForeignKey("CollectionUser")]
        public int CollectionUserId { get; set; }

        /// <summary>
        /// 收藏时间
        /// </summary>
        public DateTime CollectionTime { get; set; }

        /// <summary>
        /// 帖子
        /// </summary>
        public virtual PostEntity Post { get; set; }

        /// <summary>
        /// 收藏用户
        /// </summary>
        public virtual IdentityUserEntity CollectionUser { get; set; }
    }
}
